﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Bidder_Receiptiddetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        int Paymentid = SysFun.ToInt(SysFun.IsSQL(Request.QueryString["Paymentid"]));
        //**********08.14  start 

        HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
        Db dbone = new Db();
        string str = "select * from BuyGoodsView_200708 where Paymentid= '" + Paymentid + "'  and AccountId_ps = '" + _Account.AccountId + "'";
        bool isRight = false;
        System.Data.IDataReader dr1;
        dr1 = dbone.DataReader(str);
        while (dr1.Read())
        {
            isRight = true; break;//该goodsid是该用户的商品

        }

        dr1.Close();
        dr1.Dispose();
        dbone.Close();
        if (isRight)
        {

            //**********  end 


            string sqlQ = "select Receiptid as 发票号,ProductName as 通用名,MedicineModel 剂型,Outlookc 规格,Pack 包装,Factor 转换系数,QualityLevels 质量层次,CompanyName_PS as 配送企业,Tradeprice as 价格,InflowNum as 数量,Tradeprice*InflowNum as 总金额 from BuyGoodsView_200708 where Paymentid=" + Paymentid + "";
            Db db = new Db();
            System.Data.IDataReader dr = db.DataReader(sqlQ);
            this.GridView1.DataSource = dr;
            this.GridView1.DataBind();
        }
        else
        {
            MsgBox.Aert("没有相应的发票与其相对应！", "../Hospital/Payment.aspx");
            return;
        }

    }
}
